//
//  AMmessageTableViewController.m
//  AMwb
//
//  Created by zhc on 15/11/28.
//  Copyright © 2015年 zhc. All rights reserved.
//

#import "AMmessageTableViewController.h"
#import "AMTestViewController.h"
#import "AMNavigationViewController.h"

@interface AMmessageTableViewController ()<UITableViewDelegate>
@end

@implementation AMmessageTableViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
     NSLog(@"%@",self);
   
    self.navigationItem.rightBarButtonItem=[[UIBarButtonItem alloc] initWithTitle:@"写私信" style:0 target:self action:@selector(composeMsg)];
    
      self.navigationItem.rightBarButtonItem.enabled=NO;
}

- (void)viewWillAppear:(BOOL)animated{
    
    [super viewWillAppear:animated];
   
   // self.navigationItem.rightBarButtonItem.enabled=NO;

}

-(void)composeMsg{


}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
    
}

#pragma mark - Table view data source


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

    return 20;
    
    
}


- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    static NSString *ID = @"cell";
    
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:ID];
    
    if(!cell){
    
        cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:ID];
     
    }
    
    
    cell.textLabel.text=[NSString stringWithFormat:@"hahaa"];
    return  cell;
 
}

-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
 
    AMTestViewController *vc1=[[AMTestViewController alloc]init];
    
    

    [self.navigationController pushViewController:vc1 animated:YES];
//    NSLog(@"---%@self.na",self.navigationController);
//    
//    NSLog(@"---%@self",self);
    

}
//


@end
